package com.jz.netthings.application.providerCreate.service.impl;

import com.baomidou.mybatisplus.enums.SqlLike;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.jz.netthings.appengine.baseData.ProviderData;
import com.jz.netthings.appengine.baseData.ProviderInfo;
import com.jz.netthings.appengine.mapper.ProviderDataMapper;
import com.jz.netthings.appengine.mapper.ProviderInfoMapper;
import com.jz.netthings.appengine.queue.MachineMgr;
import com.jz.netthings.appengine.queue.ProviderQueue;
import com.jz.netthings.appengine.support.BeanSupport;
import com.jz.netthings.application.base.bean.Systemlogjiaying;
import com.jz.netthings.application.base.mapper.mysql.SystemlogjiayingMapper;
import com.jz.netthings.application.bodyCheck.bean.BodyCheck;
import com.jz.netthings.application.bodyCheck.mapper.mysql.BodyCheckMapper;
import com.jz.netthings.application.providerCreate.bean.ProviderXp;
import com.jz.netthings.application.providerCreate.bean.QueryProviderInfo;
import com.jz.netthings.application.providerCreate.mapper.mysql.ProviderXpMapper;
import com.jz.netthings.application.providerCreate.service.ProviderInfoService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.jz.netthings.application.providerReg.bean.ProviderReg;
import com.jz.netthings.application.providerReg.mapper.mysql.ProviderRegMapper;
import com.jz.netthings.application.sample.bean.PlasmaSamples;
import com.jz.netthings.application.sample.mapper.PlasmaSamplesMapper;
import com.jz.netthings.application.utils.AppUtils;
import com.jz.netthings.bean.system.JyCode;
import com.jz.netthings.bean.system.JyUser;
import com.jz.netthings.exception.AdscmSystemException;
import com.jz.netthings.security.utils.Token;
import com.jz.netthings.system.mapper.mysql.JyCodeMapper;
import com.jz.netthings.system.mapper.mysql.JyUserMapper;
import com.jz.netthings.utils.AdscmBaseUtils;
import com.jz.netthings.utils.AdscmDateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zyl
 * @since 2019-02-28
 */
@Service
public class ProviderInfoServiceImpl extends ServiceImpl<ProviderInfoMapper, ProviderInfo> implements ProviderInfoService {
    @Autowired
    JyCodeMapper jyCodeMapper;
    @Autowired
    JyUserMapper jyUserMapper;
    @Autowired
    ProviderDataMapper ProviderDataMapper;
    @Autowired
    BodyCheckMapper bodyCheckMapper;
    @Autowired
    ProviderXpMapper providerXpMapper;
    @Autowired
    PlasmaSamplesMapper plasmaSamplesMapper;
    @Autowired
    SystemlogjiayingMapper systemlogjiayingMapper;
    @Autowired
    ProviderRegMapper providerRegMapper;
    ;
    @Value("${ly.upload.baseUrl}")
    String photoUrl;
    /**
     * engine模块的IP和端口
     */
    @Value("${netty.engine.ipAddress}")
    private String engineIp;
    @Value("${netty.engine.serverPort}")
    private String engineServerPort;

    @Override
    public Page<ProviderInfo> selectProviderInfo(Page<ProviderInfo> page, QueryProviderInfo queryProviderInfo) throws AdscmSystemException {
        Wrapper<ProviderInfo> providerInfoWrapper = new EntityWrapper<>();
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getCardId(), null)) {
            providerInfoWrapper.eq("cardId", queryProviderInfo.getCardId());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getProviderName(), null)) {
            providerInfoWrapper.like("name", queryProviderInfo.getProviderName());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getSex(), null)) {
            providerInfoWrapper.eq("sex", queryProviderInfo.getSex());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getIdNo(), null)) {
            providerInfoWrapper.eq("idNo", queryProviderInfo.getIdNo());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getIdNoAddress(), null)) {
            providerInfoWrapper.like("idNoAddress", queryProviderInfo.getIdNoAddress());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getAddress(), null)) {
            providerInfoWrapper.like("address", queryProviderInfo.getAddress());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getPhone(), null)) {
            providerInfoWrapper.eq("phone", queryProviderInfo.getPhone());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getBloodType(), null)) {
            providerInfoWrapper.eq("bloodType", queryProviderInfo.getBloodType());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getCreateStartTime(), null)) {
            providerInfoWrapper.ge("createDate", queryProviderInfo.getCreateStartTime());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getCreateEndTime(), null)) {
            providerInfoWrapper.le("createDate", queryProviderInfo.getCreateEndTime());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getProviderState(), null)) {
            providerInfoWrapper.eq("providerState", Integer.valueOf(queryProviderInfo.getProviderState()));
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(queryProviderInfo.getJsr(), null)) {
            providerInfoWrapper.eq("introducer", queryProviderInfo.getJsr());
        }
        providerInfoWrapper.orderBy("createDate", false);
        providerInfoWrapper.setSqlSelect("icon", "cardId", "name", "sex", "age", "idNo", "createDate", "createNurse", "phone", "introducer", "address", "birthday"
                , "idNoAddress", "educationalLevel", "maritalStatus", "jylxId", "plasmaType", "bloodType", "veinGrade", "addIntroducerTime", "idCardPhoto", "idCardPhoto1"
                , "idCardValidDate", "idCardScanDate", "certificateRegister", "id", "refuseReason", "refuseDate", "photo");
        Page<ProviderInfo> providerInfoPage = super.selectPage(page, providerInfoWrapper);
        List<ProviderInfo> providerInfos = providerInfoPage.getRecords();

        for (ProviderInfo providerInfo : providerInfos) {
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getCreateNurse(), null)) {
                JyUser jyUser = jyUserMapper.selectById(providerInfo.getCreateNurse());
                if (AdscmBaseUtils.getInstance().isNotEmpty(jyUser, null)) {
                    providerInfo.setCreateNurseName(jyUser.getName());
                } else {
                    providerInfo.setCreateNurseName(providerInfo.getCreateNurse());
                }
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getCertificateRegister(), null)) {
                JyUser jyUser = jyUserMapper.selectById(providerInfo.getCertificateRegister());
                if (AdscmBaseUtils.getInstance().isNotEmpty(jyUser, null)) {
                    providerInfo.setCertificateRegisterName(jyUser.getName());
                } else {
                    providerInfo.setCertificateRegisterName(providerInfo.getCertificateRegister());
                }
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getEducationalLevel(), null)) {
                JyCode jyCode = new JyCode();
                jyCode.setType(8);
                jyCode.setCode(providerInfo.getEducationalLevel());
                jyCode = jyCodeMapper.selectOne(jyCode);
                providerInfo.setEducationalLevelName(jyCode.getName());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getMaritalStatus(), null)) {
                JyCode jyCode = new JyCode();
                jyCode.setType(9);
                jyCode.setCode(providerInfo.getMaritalStatus());
                jyCode = jyCodeMapper.selectOne(jyCode);
                providerInfo.setMaritalStatusName(jyCode.getName());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getJylxId(), null)) {
                JyCode jyCode = new JyCode();
                jyCode.setType(10);
                jyCode.setCode(String.valueOf(providerInfo.getJylxId()));
                jyCode = jyCodeMapper.selectOne(jyCode);
                providerInfo.setJylxIdName(jyCode.getName());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getPlasmaType(), null)) {
                JyCode jyCode = new JyCode();
                jyCode.setType(11);
                jyCode.setCode(String.valueOf(providerInfo.getPlasmaType()));
                jyCode = jyCodeMapper.selectOne(jyCode);
                providerInfo.setPlasmaTypeName(jyCode.getName());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getBloodType(), null)) {
                JyCode jyCode = new JyCode();
                jyCode.setType(12);
                jyCode.setCode(String.valueOf(providerInfo.getBloodType()));
                jyCode = jyCodeMapper.selectOne(jyCode);
                if (AdscmBaseUtils.getInstance().isNotEmpty(jyCode, null)) {
                    providerInfo.setBloodTypeName(jyCode.getName());
                } else {
                    providerInfo.setBloodTypeName((providerInfo.getBloodType()));
                }

            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getVeinGrade(), null)) {
                JyCode jyCode = new JyCode();
                jyCode.setType(13);
                jyCode.setCode(String.valueOf(providerInfo.getVeinGrade()));
                jyCode = jyCodeMapper.selectOne(jyCode);
                providerInfo.setVeinGradeName(jyCode.getName());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getProviderState(), null)) {
                JyCode jyCode = new JyCode();
                jyCode.setType(14);
                jyCode.setCode(String.valueOf(providerInfo.getProviderState()));
                jyCode = jyCodeMapper.selectOne(jyCode);
                providerInfo.setProviderStateName(jyCode.getName());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getPhoto(), null)) {
                providerInfo.setPhoto(photoUrl + providerInfo.getPhoto());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getIcon(), null)) {
                providerInfo.setIcon(photoUrl + providerInfo.getIcon());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getIdCardPhoto(), null)) {
                providerInfo.setIdCardPhoto(photoUrl + providerInfo.getIdCardPhoto());
            }
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getIdCardPhoto1(), null)) {
                providerInfo.setIdCardPhoto1(photoUrl + providerInfo.getIdCardPhoto1());
            }

        }
        providerInfoPage.setTotal(super.selectCount(providerInfoWrapper));


        return providerInfoPage;
    }

    @Override
    public Boolean updateProviderInfo(ProviderInfo providerInfo, Token token) throws AdscmSystemException {
        //首先把原来的数据给查询出来
        ProviderInfo oldproviderInfo = super.selectById(providerInfo.getId());
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getAddress(), null)) {
            oldproviderInfo.setAddress(providerInfo.getAddress());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getPhone(), null)) {
            oldproviderInfo.setPhone(providerInfo.getPhone());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getEducationalLevel(), null)) {
            oldproviderInfo.setEducationalLevel(providerInfo.getEducationalLevel());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getMaritalStatus(), null)) {
            oldproviderInfo.setMaritalStatus(providerInfo.getMaritalStatus());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getJylxId(), null)) {
            oldproviderInfo.setJylxId(providerInfo.getJylxId());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getPlasmaType(), null)) {
            oldproviderInfo.setPlasmaType(providerInfo.getPlasmaType());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getVeinGrade(), null)) {
            oldproviderInfo.setVeinGrade(providerInfo.getVeinGrade());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getIntroducer(), null)) {
            oldproviderInfo.setIntroducer(providerInfo.getIntroducer());
            if (!AdscmBaseUtils.getInstance().isNotEmpty(oldproviderInfo.getAddIntroducerTime(), null)) {
                oldproviderInfo.setAddIntroducerTime(new Date());
            }
        }
        //第一上传
        if (!AdscmBaseUtils.getInstance().isNotEmpty(oldproviderInfo.getIdCardPhoto(), null)
                && AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getIdCardPhoto(), null)) {
            String idCardPhoto = providerInfo.getIdCardPhoto().replace(photoUrl, "");
            String idCardPhoto1 = providerInfo.getIdCardPhoto1().replace(photoUrl, "");
            oldproviderInfo.setIdCardPhoto(idCardPhoto);
            oldproviderInfo.setIdCardPhoto1(idCardPhoto1);
            oldproviderInfo.setIdCardValidDate(providerInfo.getIdCardValidDate());
            oldproviderInfo.setCertificateRegister(token.getUser().getId().toString());
            oldproviderInfo.setIdCardScanDate(new Date());
        }
        if (AdscmBaseUtils.getInstance().isNotEmpty(oldproviderInfo.getIdCardPhoto(), null)
                && AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getIdCardPhoto(), null)) {
            //非第一上传，判断这两个是否相同url
            String idCardPhoto = providerInfo.getIdCardPhoto().replace(photoUrl, "");
            String idCardPhoto1 = providerInfo.getIdCardPhoto1().replace(photoUrl, "");
            if ((!idCardPhoto.equals(oldproviderInfo.getIdCardPhoto())) || (!idCardPhoto1.equals(oldproviderInfo.getIdCardPhoto1()))) {
                oldproviderInfo.setIdCardPhoto(idCardPhoto);
                oldproviderInfo.setIdCardPhoto1(idCardPhoto1);
                oldproviderInfo.setIdCardValidDate(providerInfo.getIdCardValidDate());
                oldproviderInfo.setCertificateRegister(token.getUser().getId().toString());
                oldproviderInfo.setIdCardScanDate(new Date());
            }
        }
        oldproviderInfo.setModifyTime(new Date());
        oldproviderInfo.setSynDate(AdscmDateUtils.getFormateDate(new Date()));
        boolean b = super.updateById(oldproviderInfo);
        return b;
    }

    @Transactional
    @Override
    public Boolean insertProviderInfo(ProviderInfo providerInfo, Token token) throws AdscmSystemException {
        boolean insert = false;
        synchronized (this) {
            //查询目前最大的id号
            String id = "";
            String cardId = "";
            String years = new SimpleDateFormat("yy").format(new Date());
            Wrapper<ProviderInfo> providerInfoWrapper = new EntityWrapper<>();
            providerInfoWrapper.like("id", years, SqlLike.RIGHT);
            providerInfoWrapper.orderBy("id", false);
            List<ProviderInfo> providerInfos = super.selectList(providerInfoWrapper);
            if (providerInfos.size() > 0) {
                ProviderInfo providerInfo1 = providerInfos.get(0);
                id = String.valueOf(providerInfo1.getId() + 1);
            } else {
                id = years + "00000";
            }
            //查询出最大的卡号
            Wrapper<ProviderInfo> providerInfoWrapper1 = new EntityWrapper<>();
            providerInfoWrapper1.like("cardId", "R", SqlLike.RIGHT);
            providerInfoWrapper1.orderBy("id", false);
            List<ProviderInfo> providerInfos1 = super.selectList(providerInfoWrapper1);
            if (providerInfos1.size() > 0) {
                ProviderInfo providerInfo1 = providerInfos1.get(0);
                String cardId1 = providerInfo1.getCardId().replace("R", "");
                Integer cardIdNum = Integer.valueOf(cardId1) + 1;
                DecimalFormat df = new DecimalFormat();
                df.applyPattern("000000");
                String format = df.format(cardIdNum);
                cardId = "R" + format;
            } else {
                cardId = "R000000";
            }
            providerInfo.setId(Long.valueOf(id));
            providerInfo.setCardId(cardId);
            //如果token是null代表是登记机建档，token不等于空是人工建档
            if (AdscmBaseUtils.getInstance().isNotEmpty(token, null)) {
                String idCardPhoto = providerInfo.getIdCardPhoto().replace(photoUrl, "");
                String idCardPhoto1 = providerInfo.getIdCardPhoto1().replace(photoUrl, "");
                providerInfo.setIdCardPhoto(idCardPhoto);
                providerInfo.setIdCardPhoto1(idCardPhoto1);
                providerInfo.setCertificateRegister(token.getUser().getId().toString());
                providerInfo.setIdCardScanDate(new Date());
                providerInfo.setCreateNurse(token.getUser().getId().toString());
                providerInfo.setCreateDate(new Date());
            } else {
                if (!AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getName(), null)) {
                    throw new AdscmSystemException("姓名不能为空!");
                }
                if (!AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getIdNo(), null)) {
                    throw new AdscmSystemException("身份证不能为空!");
                }
                if (!AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getBirthday(), null)) {
                    throw new AdscmSystemException("生日不能为空!");
                }
                if (!AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getAge(), null)) {
                    throw new AdscmSystemException("年龄不能为空!");
                }
                if (!AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getSex(), null)) {
                    throw new AdscmSystemException("性别不能为空!");
                }
                if (!AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getAddress(), null)) {
                    throw new AdscmSystemException("身份证地址不能为空!");
                }
                if (!AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getCreateNurse(), null)) {
                    throw new AdscmSystemException("建档护士不能为空!");
                }

            }
            providerInfo.setModifyTime(new Date());
            providerInfo.setSynDate(AdscmDateUtils.getFormateDate(new Date()));
            insert = super.insert(providerInfo);
        }

        return insert;
    }

    @Transactional
    @Override
    public void issueCard(ProviderXp providerXp) throws AdscmSystemException {
        ProviderInfo providerInfo = super.selectById(providerXp.getProviderNo());
        if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo, null)) {
            if (AdscmBaseUtils.getInstance().isNotEmpty(providerInfo.getCardId(), null)) {
                if (providerInfo.getCardId().startsWith("R")) {
                    //查询缓存
                    String tempCard = providerInfo.getCardId();
                    ProviderData providerData = ProviderDataMapper.selectById(providerInfo.getId());
                    if (!AdscmBaseUtils.getInstance().isNotEmpty(providerData, null)) {
                        return;
                    }
                    //查询体检信息
                    Wrapper<BodyCheck> bodyCheckWrapper = new EntityWrapper<>();
                    bodyCheckWrapper.eq("providerNo", providerXp.getProviderNo());
                    bodyCheckWrapper.eq("registerNo", providerData.getRegisterNo());
                    List<BodyCheck> bodyChecks = bodyCheckMapper.selectList(bodyCheckWrapper);
                    if (!(bodyChecks != null && bodyChecks.size() > 0)) {
                        return;
                    }
                    BodyCheck bodyCheck = bodyChecks.get(0);
                    if (bodyCheck.getBodyCheckResult() != 1) {
                        return;
                    }


//                    //查询胸片记录
//                    Wrapper<ProviderXp> providerXpWrapper=new EntityWrapper<>();
//                    providerXpWrapper.eq("providerNo",providerNo);
//                    providerXpWrapper.orderBy("validDate",false);
//                    List<ProviderXp> providerXps = providerXpMapper.selectList(providerXpWrapper);
//                    if (!(providerXps!=null &&providerXps.size()>0)){
//                        return;
//                    }
//                    ProviderXp providerXp = providerXps.get(0);
                    if (!"1".equals(providerXp.getResult())) {
                        return;
                    }
                    if (new Date().getTime() > providerXp.getValidDate().getTime()) {
                        return;
                    }
                    //查询化检
                    Wrapper<PlasmaSamples> plasmaSamplesWrapper = new EntityWrapper<>();
                    plasmaSamplesWrapper.eq("providerNo", providerXp.getProviderNo());
                    plasmaSamplesWrapper.eq("registerNo", providerData.getRegisterNo());
                    List<PlasmaSamples> plasmaSamples = plasmaSamplesMapper.selectList(plasmaSamplesWrapper);
                    if (!(plasmaSamples != null && plasmaSamples.size() > 0)) {
                        return;
                    }
                    PlasmaSamples plasmaSample = plasmaSamples.get(0);
                    if (!(plasmaSample.getInspectionResult() == 1)) {
                        return;
                    }
                    //根据血型去获取对应的最大号卡号
                    String newCard = "";
                    Wrapper<ProviderInfo> getMaxCardwrapper = new EntityWrapper<>();
                    getMaxCardwrapper.like("cardId", plasmaSample.getBloodType(), SqlLike.RIGHT);
                    getMaxCardwrapper.orderBy("cardId", false);
                    getMaxCardwrapper.last("limit 1 ");
                    List<ProviderInfo> providerInfos = super.selectList(getMaxCardwrapper);
                    if (providerInfos != null && providerInfos.size() > 0) {
                        ProviderInfo maxCard = providerInfos.get(0);
                        String cardId = maxCard.getCardId();
                        newCard = String.valueOf(Integer.valueOf(cardId) + 1);
                    } else {
                        newCard = plasmaSample.getBloodType() + "00000";
                    }
                    providerInfo.setCardId(newCard);
                    providerInfo.setModifyTime(new Date());
                    providerInfo.setIssueCertificateDate(new Date());
                    super.updateById(providerInfo);

                    //修改缓存
                    providerData.setProviderNo(newCard);
                    ProviderDataMapper.updateById(providerData);

//                    MachineMgr.getInstance().sendMsgToAllotCtxs( BeanSupport.loadToAllotMsg(providerData,null));
                    AppUtils.sendMsgToAllotCtxs(providerData,"http://"+engineIp+":"+engineServerPort);

                    //修改化检的时间
                    plasmaSample.setMODIFY_TIME(AdscmDateUtils.getDateFomat(new Date()));
                    plasmaSamplesMapper.updateById(plasmaSample);


                    //登记
                    Wrapper<ProviderReg> wrapper = new EntityWrapper<>();
                    wrapper.eq("registerNo", providerData.getRegisterNo());
                    wrapper.eq("idNo", providerData.getIdNo());
                    List<ProviderReg> regs = providerRegMapper.selectList(wrapper);//.getProviderRegister(providerRegister);
                    if (regs != null && regs.size() > 0) {
                        ProviderReg reg = regs.get(0);
                        reg.setModifyTime(new Date());
                        providerRegMapper.updateById(reg);
                    }
                    //体检
                    if (bodyCheck != null) {
                        bodyCheck.setMODIFY_TIME(AdscmDateUtils.getDateFomat(new Date()));
                        bodyCheckMapper.updateById(bodyCheck);
                    }


                }
            }

        }
    }


}
